package com.itheima.myCountDownLatch;

import java.util.concurrent.CountDownLatch;

public class ChildThread3 extends Thread{
    private CountDownLatch countDownLatch;

    public ChildThread3(CountDownLatch countDownLatch) {
        this.countDownLatch = countDownLatch;
    }

    int count = 20;
    @Override
    public void run() {
        System.out.println(getName() + "碗里总共有" + count + "个饺子!!!");
        for (int i = 1; i <= count; i++) {
            System.out.println(getName() + "在吃第" + i + "个饺子");
        }
        System.out.println(getName() + "碗里饺子吃完了");
        countDownLatch.countDown();
    }
}
